<div class="defaulttext">
<<$defaulttext>>
</div>

<table class="searchtable" width="100%">
<tr class="input">
<td>
<button onclick="sellingLeadsClicked()" class="largebutton">Selling leads</button>
<!--
<<inputchoice default="Selling leads" onclick="sellingLeadsClicked()" name="sellingleads" value="<<$searchvalue_sell>>" itemservice="{pagename:'businessleads',servicename:'getsellingleads'}" id="sellingleads">>
<input name="sellingleads" type="text" class="textsearch_sell first" value="<<$searchvalue_sell>>">
-->
</td>
<td>
<button onclick="buyingLeadsClicked()" class="largebutton">Buying leads</button>
<!--
<<inputchoice default="Buyinh leads" onclick="buyingLeadsClicked()" name="buyingleads" value="<<$searchvalue_buy>>" itemservice="{pagename:'businessleads',servicename:'getbuyingleads'}" id="buyingleads">>
<input name="buyingleads" type="text" class="textsearch_buy" value="<<$searchvalue_buy>>">
-->
</td>
<td>
<button class="largebutton" onclick="gotoEuTenders()">EU tenders</button>
</td>
<td width="50%" style="text-align:right;">
</td>
<td width="50%" style="text-align:right;">
<<if ($user.registertype == "3" || $user.registertype == "4")>>
    <a href="index.php?choice=profile">Post your leads here</a>
<<else if ($user.registertype != "2")>>
    <a href="index.php?choice=profile&_type=businesslead">Post your leads here</a>
<</if>>
</td>
</tr>
</table>

<script>
var activeSearchComponent = "";


jQuery(".textsearch_sell").textsearch({
    resultpage : "list_businessleads",
    defaulttext : "Selling leads",
    extraparams : {
        type : "sell"
    }
});

function sellingLeadsClicked() {
    activeSearchComponent = "sell";
}

function buyingLeadsClicked() {
    activeSearchComponent = "buy";
}

jQuery(".textsearch_buy").textsearch({
    resultpage : "list_businessleads",
    defaulttext : "Buying leads",
    extraparams : {
        type : "buy"
    }
})

function sellingLeadsClicked() {
    redirect("list_businessleads", "", {
        type : "sell"
    }, false);
}

function buyingLeadsClicked() {
    redirect("list_businessleads", "", {
        type : "buy"
    }, false);
}

function searchClicked(newWindow) {
    if (activeSearchComponent == "buy") {
        redirect("list_businessleads", "", {
            type : "buy",
            text : jQuery("input[name='buyingleads']").val()
        }, newWindow);
    } else if (activeSearchComponent == "sell") {
        redirect("list_businessleads", "", {
            type : "sell",
            text : jQuery("input[name='sellingleads']").val()
        }, newWindow);
    }
}

function gotoEuTenders() {
    window.open("http://ted.europa.eu/TED/main/HomePage.do", "_new");
}


</script>
